Integrand size = 26, antiderivative size = 169 \[ \int \frac {(e+f x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{a d}-\frac {(e+f x) \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {(e+f x) \cot (c+d x)}{a d}+\frac {2 f \log \left (\sin \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )\right )}{a d^2}+\frac {f \log (\sin (c+d x))}{a d^2}-\frac {i f \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{a d^2}+\frac {i f \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{a d^2} \]
[Out]
Time = 0.15 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.269, Rules used = {4631, 4269, 3556, 4268, 2317, 2438, 3399} \[ \int \frac {(e+f x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{a d}-\frac {i f \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{a d^2}+\frac {i f \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{a d^2}+\frac {2 f \log \left (\sin \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )\right )}{a d^2}+\frac {f \log (\sin (c+d x))}{a d^2}-\frac {(e+f x) \cot \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )}{a d}-\frac {(e+f x) \cot (c+d x)}{a d} \]
[In]
[Out]
Rule 2317
Rule 2438
Rule 3399
Rule 3556
Rule 4268
Rule 4269
Rule 4631
Rubi steps \begin{align*} \text {integral}& = \frac {\int (e+f x) \csc ^2(c+d x) \, dx}{a}-\int \frac {(e+f x) \csc (c+d x)}{a+a \sin (c+d x)} \, dx \\ & = -\frac {(e+f x) \cot (c+d x)}{a d}-\frac {\int (e+f x) \csc (c+d x) \, dx}{a}+\frac {f \int \cot (c+d x) \, dx}{a d}+\int \frac {e+f x}{a+a \sin (c+d x)} \, dx \\ & = \frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{a d}-\frac {(e+f x) \cot (c+d x)}{a d}+\frac {f \log (\sin (c+d x))}{a d^2}+\frac {\int (e+f x) \csc ^2\left (\frac {1}{2} \left (c+\frac {\pi }{2}\right )+\frac {d x}{2}\right ) \, dx}{2 a}+\frac {f \int \log \left (1-e^{i (c+d x)}\right ) \, dx}{a d}-\frac {f \int \log \left (1+e^{i (c+d x)}\right ) \, dx}{a d} \\ & = \frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{a d}-\frac {(e+f x) \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {(e+f x) \cot (c+d x)}{a d}+\frac {f \log (\sin (c+d x))}{a d^2}-\frac {(i f) \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{i (c+d x)}\right )}{a d^2}+\frac {(i f) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{i (c+d x)}\right )}{a d^2}+\frac {f \int \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \, dx}{a d} \\ & = \frac {2 (e+f x) \text {arctanh}\left (e^{i (c+d x)}\right )}{a d}-\frac {(e+f x) \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {(e+f x) \cot (c+d x)}{a d}+\frac {2 f \log \left (\sin \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )\right )}{a d^2}+\frac {f \log (\sin (c+d x))}{a d^2}-\frac {i f \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{a d^2}+\frac {i f \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{a d^2} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(404\) vs. \(2(169)=338\).
Time = 6.96 (sec) , antiderivative size = 404, normalized size of antiderivative = 2.39 \[ \int \frac {(e+f x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (-d (e+f x) \cos \left (\frac {1}{2} (c+d x)\right ) \left (1+\cot \left (\frac {1}{2} (c+d x)\right )\right )+4 d (e+f x) \sin \left (\frac {1}{2} (c+d x)\right )-2 f (c+d x) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 f \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-2 d e \log \left (\tan \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 c f \log \left (\tan \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 f (\log (\cos (c+d x))+\log (\tan (c+d x))) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-2 f \left ((c+d x) \left (\log \left (1-e^{i (c+d x)}\right )-\log \left (1+e^{i (c+d x)}\right )\right )+i \left (\operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )-\operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+d (e+f x) \sin \left (\frac {1}{2} (c+d x)\right ) \left (1+\tan \left (\frac {1}{2} (c+d x)\right )\right )\right )}{2 a d^2 (1+\sin (c+d x))} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 368 vs. \(2 (149 ) = 298\).
Time = 0.43 (sec) , antiderivative size = 369, normalized size of antiderivative = 2.18
method | result | size |
risch | \(-\frac {2 \left (-2 f x +i {\mathrm e}^{i \left (d x +c \right )} f x -2 e +i {\mathrm e}^{i \left (d x +c \right )} e +f x \,{\mathrm e}^{2 i \left (d x +c \right )}+e \,{\mathrm e}^{2 i \left (d x +c \right )}\right )}{\left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) d a}+\frac {f \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) x}{d a}-\frac {f \ln \left (1-{\mathrm e}^{i \left (d x +c \right )}\right ) x}{d a}+\frac {f \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{a \,d^{2}}+\frac {f \ln \left (1+{\mathrm e}^{2 i \left (d x +c \right )}\right )}{a \,d^{2}}+\frac {f \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{a \,d^{2}}-\frac {2 i f \arctan \left ({\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{2}}-\frac {e \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d a}+\frac {e \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d a}+\frac {c f \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d^{2} a}-\frac {f \ln \left (1-{\mathrm e}^{i \left (d x +c \right )}\right ) c}{d^{2} a}+\frac {i f \,\operatorname {Li}_{2}\left ({\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{2}}-\frac {i f \,\operatorname {Li}_{2}\left (-{\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{2}}-\frac {4 f \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right )}{d^{2} a}\) | \(369\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 858 vs. \(2 (145) = 290\).
Time = 0.32 (sec) , antiderivative size = 858, normalized size of antiderivative = 5.08 \[ \int \frac {(e+f x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \frac {(e+f x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\int \frac {e \csc ^{2}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx + \int \frac {f x \csc ^{2}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \]
[In]
[Out]
Exception generated. \[ \int \frac {(e+f x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\text {Exception raised: RuntimeError} \]
[In]
[Out]
\[ \int \frac {(e+f x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\int { \frac {{\left (f x + e\right )} \csc \left (d x + c\right )^{2}}{a \sin \left (d x + c\right ) + a} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(e+f x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\text {Hanged} \]
[In]
[Out]